package com.anis.project.medcare.editors.input;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

import com.anis.jpa.medical.model.MedicalReport;
import com.anis.jpa.medical.model.Patient;

public class ReportEditorInput implements IEditorInput {

	private MedicalReport radioReport;

	public ReportEditorInput(MedicalReport patientReport) {
		this.radioReport = patientReport;
	}

	@Override
	public Object getAdapter(Class adapter) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean exists() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getName() {
		String reportName = "";
		if (null != radioReport.getPatient())
			reportName = radioReport.getPatient().getPatientname() + "  Report";
		else
			reportName = "New Report";
		return reportName;
	}

	@Override
	public IPersistableElement getPersistable() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getToolTipText() {
		return null;
	}
	
	
	public byte[]  getReportContent(){
		return radioReport.getReportcontent();
	}

	public Patient getPatient() {
		return radioReport.getPatient();
	}

	public MedicalReport getRadioReport() {
		return this.radioReport;
	}
	
	
	

}
